<h2>Test.java 文件代码：</h2>
public class Test {<br />
&nbsp;&nbsp;public static void main(String args[]) {<br />
&nbsp; &nbsp;&nbsp;int x = 30;<br />
&nbsp; &nbsp;&nbsp;if( x == 10 ){<br />
&nbsp; &nbsp; &nbsp; &nbsp;System.out.print(&quot;Value of X is 10&quot;);<br />
&nbsp; &nbsp;&nbsp;}else if( x == 20 ){<br />
&nbsp; &nbsp; &nbsp; &nbsp;System.out.print(&quot;Value of X is 20&quot;);<br />
&nbsp; &nbsp; }else if( x == 30 ){<br />
&nbsp; &nbsp; &nbsp; &nbsp;System.out.print(&quot;Value of X is 30&quot;);<br />
&nbsp; &nbsp;&nbsp;}else{ System.out.print(&quot;这是 else 语句&quot;);<br />
&nbsp; &nbsp;&nbsp;}<br />
&nbsp; }<br />
}
<p>以上代码编译运行结果如下：</p>

<pre>
Value of X is 30</pre>
